# .PHONY=all clean clean2
# all:shmwr shmrd clean2

# shmwr:shmwr.o
# 	gcc shmwr.o -o shmwr 
# shmwr.o:shmwr.c shmdata.h
# 	gcc -c shmwr.c

# shmrd:shmrd.o
# 	gcc shmrd.o -o shmrd
# shmrd.o:shmrd.c shmdata.h
# 	@echo "正在编译"
# 	gcc -c shmrd.c

# clean:
# 	-rm shmwr shmrd *.o
# clean2:
# 	-rm  *.o

.PHONY=all clean clean2

tar = shmwr shmrd
obj = shmwr.o shmrd.o

all:$(tar) clean2

$(tar):%:%.o
	gcc  $< -o $@

$(obj):%.o:%.c
	gcc -c $< 

clean:
	-rm shmwr shmrd *.o
clean2:
	-rm  *.o




